package com.jml.原型模式.深克隆;

/**
 * 查看jinGuBang类是否一样
 * 这个不调用父类的clone方法
 */
public class DeepCloneTest {
    public static void main(String[] args) {
        QiTianDaSheng qiTianDaSheng = new QiTianDaSheng();
        try {
            QiTianDaSheng clone = (QiTianDaSheng)qiTianDaSheng.clone();
            System.out.println("深克隆："+(qiTianDaSheng.jinGuBang == clone.jinGuBang)) ;
        } catch (Exception e) {
            e.printStackTrace();
        }
        QiTianDaSheng q = new QiTianDaSheng();
        QiTianDaSheng n = q.shallowClone(q);
        System.out.println("浅克隆" + (q.jinGuBang == n.jinGuBang));


    }
}

